﻿using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;

namespace WYT.Usr.Application.Contracts.Dtos.Address.DtoValidators
{
    /// <summary>
    /// 
    /// </summary>
    public class UserAddressCreationDtoValidator : AbstractValidator<UserAddressCreationDto>
    {
        /// <summary>
        /// 
        /// </summary>
        public UserAddressCreationDtoValidator()
        {
            RuleFor(x => x.Name).NotEmpty().MaximumLength(50);
            RuleFor(x => x.Tele).NotEmpty().MaximumLength(20);
            RuleFor(x => x.ProvinceCode).NotEmpty().MaximumLength(20);
            RuleFor(x => x.ProvinceName).NotEmpty().MaximumLength(50);
            RuleFor(x => x.CityCode).NotEmpty().MaximumLength(20);
            RuleFor(x => x.CityName).NotEmpty().MaximumLength(50);
            RuleFor(x => x.AreaCode).NotEmpty().MaximumLength(20);
            RuleFor(x => x.AreaName).NotEmpty().MaximumLength(50);
            RuleFor(x => x.Address).NotEmpty().Length(4,200);
        }
    }
}
